<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/7/3 下午3:13
 * +-------------------------------------------------------------
 */

namespace app\admin\validate;

use think\Validate;

class ProjectValidate extends Validate
{
    protected $rule = [
        'title'        => 'require|max:50',
        'cate_id'      => 'require',
        'market_price' => 'require',
        'minutes'      => 'require',
        'intro'        => 'require|max:100',
        'describe'     => 'require',
    ];

    protected $message = [
        'title.require'        => '项目名称不能为空',
        'title.max'            => '项目名称最多不能超过50个字符',
        'cate_id.require'      => '项目分类不能为空',
        'market_price.require' => '市场价格不能为空',
        'minutes.require'      => '项目时长不能为空',
        'intro.require'        => '项目简介不能为空',
        'intro.max'            => '项目简介最多不能超过100个字符',
        'describe.require'     => '项目描述不能为空',
    ];

    protected $scene = [
            'add'  => ['title', 'cate_id', 'market_price', 'minutes', 'intro'],
    ];
}